// 对应分类页面的商品Model
class CategoryGoodListModel {
  List<Good> goods = [];

  CategoryGoodListModel({this.goods});

  CategoryGoodListModel.fromJson(Map<String, dynamic> json) {
    if (json['goods'] != null) {
      goods = new List<Good>();
      json['goods'].forEach((v) {
        goods.add(new Good.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.goods != null) {
      data['goods'] = this.goods.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Good {
  String id;
  String name;
  double noDiscountedPrice;
  double price;
  String image;

  Good(
      {this.id,
      this.name,
      this.noDiscountedPrice,
      this.price,
      this.image});

  Good.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    noDiscountedPrice = json['noDiscountedPrice'];
    price = json['price'];
    image = json['image'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['noDiscountedPrice'] = this.noDiscountedPrice;
    data['price'] = this.price;
    data['image'] = this.image;
    return data;
  }
}
